what's the best way of extracting a json value from a nested string